/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controladores;

import Entidades.Transportista;
import java.util.List;
import logica.jpaControllers.TransportistaJpaController;

/**
 *
 * @author USER
 */
public class CtrlTransportista {
     public CtrlTransportista() {
    }
    //guarda articulo
    public void guardarTransportista(Transportista art) {
        TransportistaJpaController ga = new TransportistaJpaController();
        ga.create(art);
    }
    
    public void eliminarTransportista(Transportista transportista) throws Exception{
        TransportistaJpaController ga = new TransportistaJpaController();
        ga.destroy(transportista.getIdTransportista());
    }

    public void modificarTransportista(Transportista a) throws Exception {
        TransportistaJpaController ga = new TransportistaJpaController();
        ga.edit(a);
    }
    
     
    public Transportista buscarTransportista_X_idTransportista(int idtransportista){
        TransportistaJpaController ga = new TransportistaJpaController();
        return ga.findTransportista(idtransportista);
       
    }
    
    public Transportista buscarTransportistaApellido(String ape) throws Exception{
        TransportistaJpaController ga = new TransportistaJpaController();
        return ga.findTransportista_x_apellido(ape);
         
    }

 public Transportista buscarTransportista_X_nroDocumento(int nroDocumento){
        TransportistaJpaController ga = new TransportistaJpaController();
        return ga.findTransportista_x_nroDocumento(nroDocumento);

    }
     public Transportista buscarTransportista_X_tipoDocumento(int tipodoc){
        TransportistaJpaController ga = new TransportistaJpaController();
        return ga.findTransportista_x_TipoDocumento(tipodoc);

    }
//     public Transportista buscarTransportista_X_tipoDocumentoNombre(String tipodoc){
//        TransportistaJpaController ga = new TransportistaJpaController();
//        return ga.findTransportista_x_TipoDocumentoNombre(tipodoc);
//
//    }
    public List buscarTodosTransportista() throws Exception{        
        TransportistaJpaController ga = new TransportistaJpaController();
        return ga.findTransportistaEntities();
    }


}
